'use strict';
import * as Koa from 'koa';
import { router, prefix } from '../middleware/router';
import { response } from '../middleware/result';
import { gifthistoryService } from '../service/gifthistory';

/** 首页轮播api对象 */
@prefix('gifthistory')
class gifthistoryController {
    @router('/query', { method: 'post' })
    async query(ctx: Koa.Context) {
        let result = await gifthistoryService.query(ctx.request.body);
        response(ctx, result);
    }
    /**
     * 手机号登录
     * @api {post} /gifthistory/sendgift 手机号登录
     * @apiDescription 手机号登录
     * @apiName sendgift
     * @apiParam (参数) {String} uid  领取人id，二维码页面自带
     * @apiParam (参数) {String} sendphone  发放人手机号
     * @apiSampleRequest /gifthistory/sendgift
     * @apiGroup Gifthistory
     * @apiVersion 1.0.0
     */
    @router('/sendgift', { method: 'post' })
    async sendgift(ctx: Koa.Context) {
        let result = await gifthistoryService.sendgift(ctx.request.body);
        response(ctx, result);
    }
    
}